﻿using MyX.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MyX.Work
{
    public class XReplayRun<T> : XIWorkRun where T : class,XIMessage
    {
        public XReplayRun(Action<T> action)
        {
            _action = action;
        }

        public bool Filter(object arg)
        {
            return arg as T != null;
        }

        public void Do(object arg)
        {
            var inputArg = arg as T;
            _action(inputArg);

        }

        private Action<T> _action;
    }
}
